package cn.sciento.onelink.sim.combo.ordered.offering;

import cn.sciento.onelink.CommonResponse;
import cn.sciento.onelink.LinkRequest;
import cn.sciento.onelink.utils.ParamUtil;
import cn.sciento.onelink.utils.TransIdUtil;
import lombok.Builder;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * 资费订购实时查询
 * @author walton
 */
@Data
@Builder
public class SimOrderedOfferingRequest extends LinkRequest<CommonResponse<SimOrderedOfferingResult>> {
    private String appId;
    private String token;
    private String queryType;
    private String groupId;
    private String msisdn;

    public SimOrderedOfferingRequest(String appId, String token, String queryType, String groupId, String msisdn) {
        super(Method.GET);
        this.appId = appId;
        this.token = token;
        this.queryType = queryType;
        this.groupId = groupId;
        this.msisdn = msisdn;
        this.path="/ec/query/ordered-offerings";
        Map<String, Object> headMap = new HashMap();
        this.setHeader(headMap);
        Map<String, Object> bodyMap = new HashMap<String, Object>();
        bodyMap.put("transid", TransIdUtil.generate(appId));
        bodyMap.put("token", token);
        bodyMap.putAll(ParamUtil.queryTypejudge(queryType, groupId, msisdn));
        this.setCompleteUrl(this.path,bodyMap);
    }
}
